<?php
if (!defined('APP_ID')) { die('No direct script access allowed'); }

class Database_Query_Mysql_Delete extends Database_Query_Mysql {
	private $_table = '';
	private $_where = '';

	public function table($table) {
		$this->_table = $table;
		return $this;
	}

	public function where($where) {
		$this->_where = $where;
		return $this;
	}

	public function compile() {
		$sql = "DELETE FROM `" . $this->_table . "`";
		
		if (!empty($this->_where)) {
			$sql .= " WHERE (" . $this->_where . ")";
		}

		return $sql;
	}
}
